﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Entity;
using System.Data.EntityClient;
using System.Data.EntityModel;
using GTServices.Entities;

namespace GTServices.Service
{
    public class Database : DbContext
    {
       
        #region Singleton
        private static Database _instance;

        public static Database Instance
        {
            get
            {
                lock (_lok)
                {
                    if (_instance == null)
                    {
                        _instance = new Database();
                    }
                }
                return _instance;
            }
        }

        private static object _lok = new object();
        #endregion
        public static string connectionStr = @"metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=System.Data.SqlServerCe.3.5;provider connection string='Data Source=C:\Users\v-johnhe\Desktop\GrepTool\Databases\CasabaGT.sdf'";

        public DbSet<Issue> Issues { get; set; }
        public DbSet<Pattern> Patterns { get; set; }

        private Database()
        {
        }
    }
}
